package com.bigmi.admin.controller;

import com.bigmi.admin.service.SensitiveService;
import com.bigmi.model.admin.dto.SensitiveDto;
import com.bigmi.model.common.dtos.ResponseResult;
import com.bigmi.model.wemedia.pojos.WmSensitive;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/api/v1/sensitive")
public class SensitiveController {
    @Autowired
    private SensitiveService sensitiveService;

    @PostMapping("/list")
    public ResponseResult listAll(@RequestBody SensitiveDto sensitiveDto){
        return sensitiveService.listAll(sensitiveDto);
    }

    @PostMapping("/save")
    public ResponseResult add(@RequestBody  WmSensitive wmSensitive){
        return sensitiveService.add(wmSensitive);
    }
    @DeleteMapping("/del/{id}")
    public ResponseResult del(@PathVariable  Integer id){
        return sensitiveService.del(id);
    }

    @PostMapping("/update")
    public ResponseResult upDate(@RequestBody WmSensitive wmSensitive){
        return sensitiveService.upDate(wmSensitive);
    }
}
